var APPICON_ANIMATION_OUT_SCALE = 3;
var APPICON_ANIMATION_OUT_TIME = 250;
+const ICON_POSITION_DELAY = 25;
+
var BaseIcon = GObject.registerClass(
class BaseIcon extends St.Bin {
_init(label, params) {
});
}
+function animateIconPosition(icon, box, flags, nChangedIcons) {
+ if (!icon.has_allocation() || icon.allocation.equal(box)) {
+ icon.allocate(box, flags);
+ return false;
+ }
+
+ icon.save_easing_state();
+ icon.set_easing_mode(Clutter.AnimationMode.EASE_OUT_QUAD);
+ icon.set_easing_delay(nChangedIcons * ICON_POSITION_DELAY);
+
+ icon.allocate(box, flags);
+
+ icon.restore_easing_state();
+
+ return true;
+}
+
var IconGrid = GObject.registerClass({
Signals: { 'animation-done': {},
'child-focused': { param_types: [Clutter.Actor.$gtype] } },
let y = box.y1 + this.topPadding;
let columnIndex = 0;
let rowIndex = 0;
+ let nChangedIcons = 0;
for (let i = 0; i < children.length; i++) {
let childBox = this._calculateChildBox(children[i], x, y, box);
} else {
if (!animating)
children[i].opacity = 255;
- children[i].allocate(childBox, flags);
+
+ if (animateIconPosition(children[i], childBox, flags, nChangedIcons))
+ nChangedIcons++;
}
columnIndex++;
let y = box.y1 + this.topPadding;
let columnIndex = 0;
+ let nChangedIcons = 0;
for (let i = 0; i < children.length; i++) {
let childBox = this._calculateChildBox(children[i], x, y, box);
- children[i].allocate(childBox, flags);
+
+ if (animateIconPosition(children[i], childBox, flags, nChangedIcons))
+ nChangedIcons++;
+
children[i].show();
columnIndex++;